home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_teTeX.idb / usr / freeware / share / texmf / dvips / pstricks / pst-coil.pro.z / pst-coil.pro
Text File  |  2001-01-10  |  2KB  |  34 lines

  1. %!
  2. % PostScript prologue for pst-coil.tex.
  3. % Version 97 patch 1, 98/06/02
  4. % For distribution, see pstricks.tex.
  5. %
  6. /tx@CoilDict 40 dict def tx@CoilDict begin
  7. /CoilLoop { /t ED t sin AspectSin mul t 180 div AspectCos mul add t cos
  8. lineto } def
  9. /Coil { /Inc ED dup sin /AspectSin ED cos /AspectCos ED /ArmB ED /ArmA ED
  10. /h ED /w ED /y1 ED /x1 ED /y0 ED /x0 ED x0 y0 translate y1 y0 sub x1 x0
  11. sub 2 copy Pyth /TotalLength ED Atan rotate /BeginAngle ArmA AspectCos
  12. Div w h mul Div 360 mul def /EndAngle TotalLength ArmB sub AspectCos Div
  13. w h mul Div 360 mul def 1 0 0 0 ArrowA ArmA 0 lineto /mtrx CM def w h
  14. mul 2 Div w 2 Div scale BeginAngle Inc EndAngle { CoilLoop } for
  15. EndAngle CoilLoop mtrx setmatrix TotalLength ArmB sub 0 lineto CP
  16. % DG/SR modification begin - Jun.  2, 1998 - Patch 1 (from Michael Vulis)
  17. % TotalLength 0 ArrowB lineto } def
  18. TotalLength 0 ArrowB lineto
  19. pop pop pop pop } def
  20. % DG/SR modification end
  21. /AltCoil { /Inc ED dup sin /AspectSin ED cos /AspectCos ED /h ED /w ED
  22. /EndAngle ED /BeginAngle ED /mtrx CM def w h mul 2 Div w 2 Div scale
  23. BeginAngle sin AspectSin mul BeginAngle 180 div AspectCos mul add
  24. BeginAngle cos /lineto load stopped { moveto } if BeginAngle Inc
  25. EndAngle { CoilLoop } for EndAngle CoilLoop mtrx setmatrix } def
  26. /ZigZag { /ArmB ED /ArmA ED 2 div /w ED w mul /h ED /y1 ED /x1 ED /y0 ED
  27. /x0 ED x1 y1 translate y0 y1 sub x0 x1 sub 2 copy Pyth /TotalLength ED
  28. Atan rotate TotalLength ArmA sub ArmB sub dup h div cvi /n ED n h mul
  29. sub 2 div dup ArmA add /ArmA ED ArmB add /ArmB ED /x ArmB h 2 div add
  30. def mark 0 0 ArmB 0 n { x w /w w neg def /x x h add def } repeat
  31. TotalLength ArmA sub 0 TotalLength 0 } def
  32. end
  33. % END pst-coil.pro
  34.